package it.getta.vicinometro.tracking;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class TrackingService extends Service {

	private TrackingTask mTask;
	
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}
	
	@Override
	public void onStart(Intent intent, int startId) {
		mTask = new TrackingTask(this);
		mTask.execute();
		super.onStart(intent, startId);
	}
	
//	@Override
//	public int onStartCommand(Intent intent, int flags, int startId) {
//		mTask = new TrackingTask(this);
//		mTask.execute();
//		return super.onStartCommand(intent, flags, startId);
//	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		mTask.stopRunning();
	}

	public TrackingTask getTask() {
		return mTask;
	}

}
